class_name FSMVisualization
extends Control

#region 属性
@export var enable:bool
@onready var state_name: RichTextLabel = $StateName
@onready var fsm: FSM = %FSM
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
#endregion
#region 公共方法
#endregion
#region 私有方法
#endregion
#region 生命周期函数
func _ready() -> void:
	enable = enable and GameManager.game_mode == GameEnum.GameMode.Dev
	visible = enable
func _process(delta: float) -> void:
	if not enable:
		return
	if state_name and fsm:
		state_name.text = fsm.target_state.state_name
		if (scale.x > 0.001 and get_parent().global_scale.y < -0.001) or (scale.x < -0.001 and get_parent().global_scale.y > 0.001):
			scale = scale * Vector2(-1,1)
#endregion
